package com.hellogood.yaohuo.server.mgr;

import java.util.List;

import com.hellogood.yaohuo.server.dao.factory.DAOFactory;
import com.hellogood.yaohuo.shared.vo.BasicVo;

public class CommonMgr {
	public BasicVo getBasicVo(String code, String orgCode) {
		BasicVo vo = null;
		if (code != null && orgCode != null) {
			code = code.split("-")[0].trim();
			orgCode = orgCode.split("-")[0].trim();
			vo = DAOFactory.getInstance().createCommonDAO().getBasicVo(code, orgCode);
		}

		// if (vo == null) {
		// return vo;
		// }
		// vo.setClsName(DBInitial.gClassMap.get(vo.getClsCode()).getClsName());
		// vo.setDepName(DBInitial.deptMap.get(vo.getDepCode()).getDepName());
		return vo;
	}

	public BasicVo getBasicVoPeisong(String code, String orgCode) {
		BasicVo vo = null;
		if (code != null && orgCode != null) {
			code = code.split("-")[0].trim();
			orgCode = orgCode.split("-")[0].trim();
			vo = DAOFactory.getInstance().createCommonDAO().getBasicVoPeisong(code, orgCode);
		}
		return vo;
	}

	public BasicVo getBasicVoPeisongTuihuo(String code, String orgCode) {
		BasicVo vo = null;
		if (code != null && orgCode != null) {
			code = code.split("-")[0].trim();
			orgCode = orgCode.split("-")[0].trim();
			vo = DAOFactory.getInstance().createCommonDAO().getBasicVoPeisongTuihuo(code, orgCode);
		}
		return vo;
	}

	public List<String> getMkCodeByUser(String user) {
		return DAOFactory.getInstance().createMkDAO().getMkCodeByUser(user);
	}
}
